from django import forms
from .models import Topic,Entry

### 定义topic表单
class TopicForm(forms.ModelForm):
    class Meta:
        model=Topic
        fields=['text']
        labels={'text':''}

## 添加实例表单
class EntryForm(forms.ModelForm):
    class Meta:
        model=Entry
        fields=['text']
        labels={'text':''}
        widgets={'text':forms.Textarea(attrs={'cols': 80})}    ## 给表单指定宽度